package com.halflife.comeElectricity.battery;

import com.halflife.comeElectricity.batteryBox.BatteryBox;
import com.halflife.framework.generator.annotation.Join;
import com.halflife.framework.generator.annotation.QueryAnn;
import com.halflife.framework.participant.Department;

/**
 * Created by zhaoyf on 2018/6/4.
 */
@QueryAnn(title = "电池",mainTitle = "电箱管理",table = "t_battery")
public class Battery {
    public enum BatteryStatus{
        ENOUGHPOWER,LOWPOWER,ERROR,
    }
    private Integer id;

    @QueryAnn(value = "编码", operate = "like",refered = true)
    private String no;
    @QueryAnn(value = "名称", operate = "like",refered = true)
    private String name;
    @QueryAnn(value = "备注")
    private String memo;
    @QueryAnn(value = "状态",refered = true)
    private Integer status;
    @QueryAnn(value = "是否有效")
    private Boolean valid;
    @QueryAnn(value = "电池柜Id")
    private Integer cabinetId;
    @QueryAnn(value = "电池箱Id")
    private Integer batteryBoxId;
    @QueryAnn(value = "订单")
    private Integer orderId;

    @QueryAnn(value = "电池箱")
    @Join(join = "batteryCabinet")
    private BatteryBox batteryBox;
    @QueryAnn(value = "DepartmentId",refered = true)
    private Integer departmentId;
    @QueryAnn(value = "Department",refered = true)
    @Join()
    private Department department;
    public void init() {
        this.setValid(Boolean.TRUE);
        this.setStatus(BatteryStatus.ENOUGHPOWER.ordinal());
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public Boolean getValid() {
        return valid;
    }

    public void setValid(Boolean valid) {
        this.valid = valid;
    }

    public Integer getCabinetId() {
        return cabinetId;
    }

    public void setCabinetId(Integer cabinetId) {
        this.cabinetId = cabinetId;
    }

    public BatteryBox getBatteryBox() {
        return batteryBox;
    }

    public void setBatteryBox(BatteryBox batteryBox) {
        this.batteryBox = batteryBox;
    }

    public Integer getOrderId() {
        return orderId;
    }

    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    public Integer getBatteryBoxId() {
        return batteryBoxId;
    }

    public void setBatteryBoxId(Integer batteryBoxId) {
        this.batteryBoxId = batteryBoxId;
    }

    public Integer getDepartmentId() {
        return departmentId;
    }

    public void setDepartmentId(Integer departmentId) {
        this.departmentId = departmentId;
    }

    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }
}
